package com.lyw.guide

import com.blankj.utilcode.util.LogUtils
import com.lu.library.base.BaseViewModel
import com.lu.library.base.IUiIntent
import com.lu.library.base.IUiState

sealed class GuideState: IUiState {
    data object INIT:GuideState()
    data class SUCCESS(val images:List<String>):GuideState()
}
sealed class GuideIntent:IUiIntent{
    data object GetBanner:GuideIntent()
    data object ClickFinished:GuideIntent()
}


class GuideViewModel:BaseViewModel<GuideState,GuideIntent>() {
    override fun initUiState(): GuideState {
        return GuideState.INIT
    }

    override fun handleIntent(intent: GuideIntent) {
        LogUtils.d("intent:$intent")
        when(intent){
            GuideIntent.GetBanner->{
                updateUiState {
                    GuideState.SUCCESS(listOf("https://sjbz-fd.zol-img.com.cn/t_s1080x1920c/g5/M00/00/02/ChMkJ1fJUwuIUssCAA39sthJrGMAAU9nwNNNewADf3K734.jpg",
                        "https://sjbz-fd.zol-img.com.cn/t_s1080x1920c/g2/M00/0A/08/ChMlWV6eZciIUV7eACVsGSuG93UAAOfbQMCii4AJWwx932.jpg",
                        "https://sjbz-fd.zol-img.com.cn/t_s1080x1920c/g2/M00/01/02/ChMlWl7e-IKIJcAUABf2rUbR7hcAAP5sQJf9gIAF_bF286.jpg"));
                }
            }
            else -> {}
        }
    }
}